package com.hdu.careerplan.pojo.entity;

import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import lombok.Data;

/**
 * 
 * @TableName competence_info
 */
@TableName(value ="competence_info", autoResultMap = true)
@Data
public class CompetenceInfo implements Serializable {
    /**
     * 用户ID
     */
    private Long userId;

    /**
     * 
     */
    private String direction;

    /**
     * 符合要求的技术
     */
    @TableField(value = "match_skills", typeHandler = FastjsonTypeHandler.class)
    private JSONArray matchedSkills;

    /**
     * 评分
     */
    private Double score;

    /**
     * 欠缺的技能
     */
    @TableField(value = "rec_skills",typeHandler = FastjsonTypeHandler.class)
    private JSONArray shortboardSkills;  //前端的命名

    /**
     * 评价、描述
     */
    @TableField(value = "suggestions")
    private String interpretation;

    /**
     * 评价
     */
//    private String description;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CompetenceInfo other = (CompetenceInfo) that;
        return (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getDirection() == null ? other.getDirection() == null : this.getDirection().equals(other.getDirection()))
            && (this.getMatchedSkills() == null ? other.getMatchedSkills() == null : this.getMatchedSkills().equals(other.getMatchedSkills()))
            && (this.getScore() == null ? other.getScore() == null : this.getScore().equals(other.getScore()))
            && (this.getShortboardSkills() == null ? other.getShortboardSkills() == null : this.getShortboardSkills().equals(other.getShortboardSkills()))
            && (this.getInterpretation() == null ? other.getInterpretation() == null : this.getInterpretation().equals(other.getInterpretation()));
//            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getDirection() == null) ? 0 : getDirection().hashCode());
        result = prime * result + ((getMatchedSkills() == null) ? 0 : getMatchedSkills().hashCode());
        result = prime * result + ((getScore() == null) ? 0 : getScore().hashCode());
        result = prime * result + ((getShortboardSkills() == null) ? 0 : getShortboardSkills().hashCode());
        result = prime * result + ((getInterpretation() == null) ? 0 : getInterpretation().hashCode());
//        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", userId=").append(userId);
        sb.append(", direction=").append(direction);
        sb.append(", matchSkills=").append(matchedSkills);
        sb.append(", score=").append(score);
        sb.append(", shortboardSkills=").append(shortboardSkills);
        sb.append(", interpretation=").append(interpretation);
//        sb.append(", description=").append(description);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}